<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <script src="https://cdn.tailwindcss.com"></script>
    </head>
    <body>
        <section class="m-3 p-5 border-2 border-black-500">
            <h1 class="text-lg text-red-500 font-bold">绝对定位</h1>
            <div class="relative w-1/2 h-12 mb-4 bg-red-500">
                <p>相对定位</p>
                <div class="absolute bottom-1 right-1 bg-green-400">
                    <p>绝对定位</p>
                </div>
            </div>
            <div class="relative h-32 w-32 mb-4 bg-yellow-500">
                <div class="absolute top-0 right-0 h-16 w-16 bg-yellow-300">
                    绝对定位
                </div>
            </div>
            <div class="relative h-32 w-32 bg-green-500">
                <div class="absolute bottom-0 left-0 h-16 w-16 bg-yellow-300">
                    07
                </div>
            </div>
        </section>

        <section class="m-3 p-5 border-2 border-black-500">
            <h1 class="text-lg text-red-500 font-bold">定位偏移</h1>
            <div class="relative h-32 w-auto bg-green-500">
                <div class="absolute inset-x-2 inset-y-2 bg-yellow-300">
                    inset-x-1(left-2 right-2)<br />
                    inset-y-1(top-2 bottom-2)
                </div>
            </div>
        </section>

        <section class="m-3 p-5 border-2 border-black-500">
            <h1 class="text-lg text-red-500 font-bold">Display类型</h1>
            <span class="inline bg-red-500"
                >This is display inline and will wrap normally</span
            >
            <span class="inline-block bg-red-500"
                >This is display inline and will wrap normally</span
            >
            <span class="block mt-2 bg-red-500"
                >This is display inline and will wrap normally</span
            >
        </section>

        <section class="m-3 p-5 border-2 border-black-500">
            <h1 class="text-lg text-red-500 font-bold">z-index大小</h1>
            <div class="relative h-36">
                <div class="absolute left-10 w-24 h-24 bg-blue-200 z-40">1</div>
                <div class="absolute left-20 w-24 h-24 bg-blue-300">2</div>
                <div class="absolute left-40 w-24 h-24 bg-blue-400 z-10">3</div>
                <div class="absolute left-60 w-24 h-24 bg-blue-500 z-20">4</div>
                <div class="absolute left-80 w-24 h-24 bg-blue-600">5</div>
            </div>
        </section>

        <section class="m-3 p-5 border-2 border-black-500">
            <h1 class="text-lg text-red-500 font-bold">浮动</h1>
            <div class="w-10 h-10 bg-blue-200 text-center float-right">01</div>
            <div class="w-10 h-10 bg-blue-200 text-center float-left">02</div>
        </section>
    </body>
</html>
